#ifndef BLAS_H
#define BLAS_H
#include "cform.h"

void flatten(float *x, int size, int layers, int batch, int forward);

void pm(int M, int N, float *A);

float *random_matrix(int rows, int cols);

void time_random_matrix(int TA, int TB, int m, int k, int n);

void scale_bias(float *output, float *scales, int batch, int n, int size);

void mean_cpu(float *x, int batch, int filters, int spatial, float *mean);

void variance_cpu(float *x, float *mean, int batch, int filters, int spatial, float *variance);

void normalize_cpu(float *x, float *mean, float *variance, int batch, int filters, int spatial);

void regorg_cpu(float *x, int w, int h, int c, int batch, int stride, int forward, float *out);

void softmax(float *input, int n, float temp, int stride, float *output);

void softmax_cpu(float *input, int n, int batch, int batch_offset, int groups, int group_offset,
    int stride, float temp, float *output);

void logistic_x_ent_cpu(int n, float *pred, float *truth, float *delta, float *error);

void softmax_x_ent_cpu(int n, float *pred, float *truth, float *delta, float *error);

void weighted_sum_cpu();

#endif // BLAS_H